/**
 * 
 */
package com.gopay.common.cps.dao.entrust.impl;

import java.io.Serializable;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.entrust.CpsDSContractInfoQueryDAO;
import com.gopay.common.domain.cps.CpsBtContractInfo;
import com.gopay.common.domain.entrust.EntrustContractInfo;


/**
 * 网关委托授权信息表
 * 
 * @CpsDSContractInfoQueryDAOImpl.java
 * @author zhuliang
 * @2016-12-27 下午15:31:15 www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("cpsDSContractInfoQueryDAO")
public class CpsDSContractInfoQueryDAOImpl extends BaseDAOImpl<EntrustContractInfo, Serializable> implements CpsDSContractInfoQueryDAO {
   
	protected final static Log logger = LogFactory.getLog(CpsDSContractInfoQueryDAOImpl.class);
	
    @Override
    public EntrustContractInfo getByContractNo(String contractNo) {
        DetachedCriteria criteria = DetachedCriteria.forClass(EntrustContractInfo.class);
        criteria.add(Restrictions.eq("contractNo", contractNo));
        List<EntrustContractInfo> list = this.findByCriteria(criteria);
        return list.size() > 0 ? list.get(0) : null;
    }



}
